/*
  Copyright (c) 2010 Les Newell. All rights reserved

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program. If not, see <http://www.gnu.org/licenses/>.
*/



//define the module.
DEFINE_MODULE(GPS,Module)
//Note the lack of an opening curly bracket.


    //Only use this to expose sockets and parameters. Do most of your
    //initialisastion in Init()
    GPS()
    {
        AddSocket("GPS.Latitude", &m_latitude);
        AddSocket("GPS.Longitude", &m_longitude);
        AddSocket("GPS.Altitude", &m_altitude);
        AddSocket("GPS.Heading", &m_heading);
        AddSocket("GPS.Speed", &m_speed);
        AddSocket("GPS.OK",&m_ok);
    }

    //A parameter has changed. This happens at bootup if the EEPROM
    //contains valid data and at run-time if the user changes a
    //parameter over the serial link
    virtual void ParamChanged(Socket * param)
    {
    }

    //Initialise the module
    //set up hardware etc
    virtual void Init()
    {
    }

    //Here is where you do your work. It is called at the rate defined by SetInterval
    virtual void Loop(const unsigned long& interval)
    {
    }

protected:
    Socket8 m_ok;
    SocketF m_latitude;
    SocketF m_longitude;
    SocketF m_altitude;
    SocketF m_heading;
    SocketF m_speed;

};


